using System.Drawing;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading;
using System.Diagnostics;
using System.Net;
using System.Security.Cryptography;
using System.Threading.Tasks;
using System.Windows.Media;

using Styx;
using Styx.CommonBot.Database;
using Styx.WoWInternals.WoWObjects;
using Styx.CommonBot;
using Styx.Common;

namespace BrodieQBLoader
{
	public class QBLoader
	{
		private static LocalPlayer Me { get { return StyxWoW.Me; } }

        public static void UpdateAllMissing()
        {
            CreateAFile(Path.Combine(Utilities.AssemblyDirectory + @"\Quest Behaviors\TBM\TheBrodieManHelper.cs"),
                global::BrodiesPlugin.Properties.Resources.TheBrodieManHelper, Path.Combine(Utilities.AssemblyDirectory + @"\Quest Behaviors\TBM"));

            CreateAFile(Path.Combine(Utilities.AssemblyDirectory + @"\Quest Behaviors\Hooks\TheEndlessFlowHook-Horde.cs"),
                global::BrodiesPlugin.Properties.Resources.TheEndlessFlowHook_Horde, Path.Combine(Utilities.AssemblyDirectory + @"\Quest Behaviors\Hooks"));

            CreateAFile(Path.Combine(Utilities.AssemblyDirectory + @"\Quest Behaviors\SpecificQuests\Darkmoon Faire\DMF_Cannon.cs"),
                global::BrodiesPlugin.Properties.Resources.DMF_Cannon, Path.Combine(Utilities.AssemblyDirectory + @"\Quest Behaviors\SpecificQuests\Darkmoon Faire"));
            CreateAFile(Path.Combine(Utilities.AssemblyDirectory + @"\Quest Behaviors\SpecificQuests\Darkmoon Faire\DMF_Gnoll.cs"),
                global::BrodiesPlugin.Properties.Resources.DMF_Gnoll, Path.Combine(Utilities.AssemblyDirectory + @"\Quest Behaviors\SpecificQuests\Darkmoon Faire"));
            CreateAFile(Path.Combine(Utilities.AssemblyDirectory + @"\Quest Behaviors\SpecificQuests\Darkmoon Faire\DMF_Shoot.cs"),
                global::BrodiesPlugin.Properties.Resources.DMF_Shoot, Path.Combine(Utilities.AssemblyDirectory + @"\Quest Behaviors\SpecificQuests\Darkmoon Faire"));
            CreateAFile(Path.Combine(Utilities.AssemblyDirectory + @"\Quest Behaviors\SpecificQuests\Darkmoon Faire\DMF_Tonk.cs"),
                global::BrodiesPlugin.Properties.Resources.DMF_Tonk, Path.Combine(Utilities.AssemblyDirectory + @"\Quest Behaviors\SpecificQuests\Darkmoon Faire"));
            CreateAFile(Path.Combine(Utilities.AssemblyDirectory + @"\Quest Behaviors\SpecificQuests\Darkmoon Faire\DMF_Turtle.cs"),
                global::BrodiesPlugin.Properties.Resources.DMF_Turtle, Path.Combine(Utilities.AssemblyDirectory + @"\Quest Behaviors\SpecificQuests\Darkmoon Faire"));

            CreateAFile(Path.Combine(Utilities.AssemblyDirectory + @"\Quest Behaviors\SpecificQuests\Eastern Kingdoms\Silverpine Forest\27232-TheWatersRunRed.cs"),
                global::BrodiesPlugin.Properties.Resources._27232_TheWatersRunRed, Path.Combine(Utilities.AssemblyDirectory + @"\Quest Behaviors\SpecificQuests\Eastern Kingdoms\Silverpine Forest"));
            CreateAFile(Path.Combine(Utilities.AssemblyDirectory + @"\Quest Behaviors\SpecificQuests\Eastern Kingdoms\Tirisfal Glades\24999-TirisfalGlades-PlantingtheSeedofFear.cs"),
                global::BrodiesPlugin.Properties.Resources._24999_TirisfalGlades_PlantingtheSeedofFear, Path.Combine(Utilities.AssemblyDirectory + @"\Quest Behaviors\SpecificQuests\Eastern Kingdoms\Tirisfal Glades"));
            CreateAFile(Path.Combine(Utilities.AssemblyDirectory + @"\Quest Behaviors\SpecificQuests\Eastern Kingdoms\Western Plaguelands\26925-ArajTheSummoner.cs"),
                global::BrodiesPlugin.Properties.Resources._26925_ArajTheSummoner, Path.Combine(Utilities.AssemblyDirectory + @"\Quest Behaviors\SpecificQuests\Eastern Kingdoms\Western Plaguelands"));
            CreateAFile(Path.Combine(Utilities.AssemblyDirectory + @"\Quest Behaviors\SpecificQuests\Eastern Kingdoms\Western Plaguelands\27164-ArajTheSummoner.cs"),
                global::BrodiesPlugin.Properties.Resources._27164_ArajTheSummoner, Path.Combine(Utilities.AssemblyDirectory + @"\Quest Behaviors\SpecificQuests\Eastern Kingdoms\Western Plaguelands"));
            CreateAFile(Path.Combine(Utilities.AssemblyDirectory + @"\Quest Behaviors\SpecificQuests\Eastern Kingdoms\Westfall\26257-ItsAlive.cs"),
                global::BrodiesPlugin.Properties.Resources._26257_ItsAlive, Path.Combine(Utilities.AssemblyDirectory + @"\Quest Behaviors\SpecificQuests\Eastern Kingdoms\Westfall"));

            CreateAFile(Path.Combine(Utilities.AssemblyDirectory + @"\Quest Behaviors\SpecificQuests\Kalimdor\Ashenvale\13624-ASquadOfYourOwn.cs"),
                global::BrodiesPlugin.Properties.Resources._13624_ASquadOfYourOwn, Path.Combine(Utilities.AssemblyDirectory + @"\Quest Behaviors\SpecificQuests\Kalimdor\Ashenvale"));
            CreateAFile(Path.Combine(Utilities.AssemblyDirectory + @"\Quest Behaviors\SpecificQuests\Kalimdor\Ashenvale\13853-ReturnFire.cs"),
                global::BrodiesPlugin.Properties.Resources._13853_ReturnFire, Path.Combine(Utilities.AssemblyDirectory + @"\Quest Behaviors\SpecificQuests\Kalimdor\Ashenvale"));
            CreateAFile(Path.Combine(Utilities.AssemblyDirectory + @"\Quest Behaviors\SpecificQuests\Kalimdor\Ashenvale\13886-Vortex.cs"),
                global::BrodiesPlugin.Properties.Resources._13886_Vortex, Path.Combine(Utilities.AssemblyDirectory + @"\Quest Behaviors\SpecificQuests\Kalimdor\Ashenvale"));
            CreateAFile(Path.Combine(Utilities.AssemblyDirectory + @"\Quest Behaviors\SpecificQuests\Kalimdor\Ashenvale\13888-Vortex.cs"),
                global::BrodiesPlugin.Properties.Resources._13888_Vortex, Path.Combine(Utilities.AssemblyDirectory + @"\Quest Behaviors\SpecificQuests\Kalimdor\Ashenvale"));
            CreateAFile(Path.Combine(Utilities.AssemblyDirectory + @"\Quest Behaviors\SpecificQuests\Kalimdor\Ashenvale\13935-DefendTheTree.cs"),
                global::BrodiesPlugin.Properties.Resources._13935_DefendTheTree, Path.Combine(Utilities.AssemblyDirectory + @"\Quest Behaviors\SpecificQuests\Kalimdor\Ashenvale"));

            CreateAFile(Path.Combine(Utilities.AssemblyDirectory + @"\Quest Behaviors\SpecificQuests\Kalimdor\Azshara\14134-TheCaptainsLogs.cs"),
                global::BrodiesPlugin.Properties.Resources._14134_TheCaptainsLogs, Path.Combine(Utilities.AssemblyDirectory + @"\Quest Behaviors\SpecificQuests\Kalimdor\Azshara"));
            CreateAFile(Path.Combine(Utilities.AssemblyDirectory + @"\Quest Behaviors\SpecificQuests\Kalimdor\Azshara\14135-UpATree.cs"),
                global::BrodiesPlugin.Properties.Resources._14135_UpATree, Path.Combine(Utilities.AssemblyDirectory + @"\Quest Behaviors\SpecificQuests\Kalimdor\Azshara"));
            CreateAFile(Path.Combine(Utilities.AssemblyDirectory + @"\Quest Behaviors\SpecificQuests\Kalimdor\Azshara\14146-DefendTheGates.cs"),
                global::BrodiesPlugin.Properties.Resources._14146_DefendTheGates, Path.Combine(Utilities.AssemblyDirectory + @"\Quest Behaviors\SpecificQuests\Kalimdor\Azshara"));
            CreateAFile(Path.Combine(Utilities.AssemblyDirectory + @"\Quest Behaviors\SpecificQuests\Kalimdor\Azshara\14155-Arborcide.cs"),
                global::BrodiesPlugin.Properties.Resources._14155_Arborcide, Path.Combine(Utilities.AssemblyDirectory + @"\Quest Behaviors\SpecificQuests\Kalimdor\Azshara"));
            CreateAFile(Path.Combine(Utilities.AssemblyDirectory + @"\Quest Behaviors\SpecificQuests\Kalimdor\Azshara\14226-TroubleUnderFoot.cs"),
                global::BrodiesPlugin.Properties.Resources._14226_TroubleUnderFoot, Path.Combine(Utilities.AssemblyDirectory + @"\Quest Behaviors\SpecificQuests\Kalimdor\Azshara"));
            CreateAFile(Path.Combine(Utilities.AssemblyDirectory + @"\Quest Behaviors\SpecificQuests\Kalimdor\Azshara\14310-SegmentationFault.cs"),
                global::BrodiesPlugin.Properties.Resources._14310_SegmentationFault, Path.Combine(Utilities.AssemblyDirectory + @"\Quest Behaviors\SpecificQuests\Kalimdor\Azshara"));
            CreateAFile(Path.Combine(Utilities.AssemblyDirectory + @"\Quest Behaviors\SpecificQuests\Kalimdor\Azshara\KillShredder.cs"),
                global::BrodiesPlugin.Properties.Resources.KillShredder, Path.Combine(Utilities.AssemblyDirectory + @"\Quest Behaviors\SpecificQuests\Kalimdor\Azshara"));

            CreateAFile(Path.Combine(Utilities.AssemblyDirectory + @"\Quest Behaviors\SpecificQuests\Kalimdor\AzuremystIsle\9544-TheProphecyofAkida.cs"),
                global::BrodiesPlugin.Properties.Resources._9544_TheProphecyofAkida, Path.Combine(Utilities.AssemblyDirectory + @"\Quest Behaviors\SpecificQuests\Kalimdor\AzuremystIsle"));

            CreateAFile(Path.Combine(Utilities.AssemblyDirectory + @"\Quest Behaviors\SpecificQuests\Kalimdor\Darkshore\13514-TheAncientsIre.cs"),
                global::BrodiesPlugin.Properties.Resources._13514_TheAncientsIre, Path.Combine(Utilities.AssemblyDirectory + @"\Quest Behaviors\SpecificQuests\Kalimdor\Darkshore"));
            CreateAFile(Path.Combine(Utilities.AssemblyDirectory + @"\Quest Behaviors\SpecificQuests\Kalimdor\Darkshore\13588-EyeofAllStorms.cs"),
                global::BrodiesPlugin.Properties.Resources._13588_EyeofAllStorms, Path.Combine(Utilities.AssemblyDirectory + @"\Quest Behaviors\SpecificQuests\Kalimdor\Darkshore"));
            CreateAFile(Path.Combine(Utilities.AssemblyDirectory + @"\Quest Behaviors\SpecificQuests\Kalimdor\Darkshore\13885-DefenseOfDarkshore.cs"),
                global::BrodiesPlugin.Properties.Resources._13885_DefenseOfDarkshore, Path.Combine(Utilities.AssemblyDirectory + @"\Quest Behaviors\SpecificQuests\Kalimdor\Darkshore"));

            CreateAFile(Path.Combine(Utilities.AssemblyDirectory + @"\Quest Behaviors\SpecificQuests\Kalimdor\Southern Barrens\24546-ALineInTheDirt.cs"),
                global::BrodiesPlugin.Properties.Resources._24546_ALineInTheDirt, Path.Combine(Utilities.AssemblyDirectory + @"\Quest Behaviors\SpecificQuests\Kalimdor\Southern Barrens"));
            CreateAFile(Path.Combine(Utilities.AssemblyDirectory + @"\Quest Behaviors\SpecificQuests\Kalimdor\Southern Barrens\24939-RunOutTheGuns.cs"),
                global::BrodiesPlugin.Properties.Resources._24939_RunOutTheGuns, Path.Combine(Utilities.AssemblyDirectory + @"\Quest Behaviors\SpecificQuests\Kalimdor\Southern Barrens"));
            CreateAFile(Path.Combine(Utilities.AssemblyDirectory + @"\Quest Behaviors\SpecificQuests\Kalimdor\Southern Barrens\25045-ALineInTheDirt.cs"),
                global::BrodiesPlugin.Properties.Resources._25045_ALineInTheDirt, Path.Combine(Utilities.AssemblyDirectory + @"\Quest Behaviors\SpecificQuests\Kalimdor\Southern Barrens"));

            CreateAFile(Path.Combine(Utilities.AssemblyDirectory + @"\Quest Behaviors\SpecificQuests\Kalimdor\Stonetalon Mountains\25614-TheOnlyWayDown.cs"),
                global::BrodiesPlugin.Properties.Resources._25614_TheOnlyWayDown, Path.Combine(Utilities.AssemblyDirectory + @"\Quest Behaviors\SpecificQuests\Kalimdor\Stonetalon Mountains"));
            CreateAFile(Path.Combine(Utilities.AssemblyDirectory + @"\Quest Behaviors\SpecificQuests\Kalimdor\Stonetalon Mountains\25652-CommandeerThatBalloon.cs"),
                global::BrodiesPlugin.Properties.Resources._25652_CommandeerThatBalloon, Path.Combine(Utilities.AssemblyDirectory + @"\Quest Behaviors\SpecificQuests\Kalimdor\Stonetalon Mountains"));
            CreateAFile(Path.Combine(Utilities.AssemblyDirectory + @"\Quest Behaviors\SpecificQuests\Kalimdor\Stonetalon Mountains\25889-SaveTheChildren.cs"),
                global::BrodiesPlugin.Properties.Resources._25889_SaveTheChildren, Path.Combine(Utilities.AssemblyDirectory + @"\Quest Behaviors\SpecificQuests\Kalimdor\Stonetalon Mountains"));
            CreateAFile(Path.Combine(Utilities.AssemblyDirectory + @"\Quest Behaviors\SpecificQuests\Kalimdor\Stonetalon Mountains\26028-MrDsWildRide.cs"),
                global::BrodiesPlugin.Properties.Resources._26028_MrDsWildRide, Path.Combine(Utilities.AssemblyDirectory + @"\Quest Behaviors\SpecificQuests\Kalimdor\Stonetalon Mountains"));

            CreateAFile(Path.Combine(Utilities.AssemblyDirectory + @"\Quest Behaviors\SpecificQuests\Kalimdor\Thousand Needles\25532-25533-PirateAccuracyIncreasing.cs"),
                global::BrodiesPlugin.Properties.Resources._25532_25533_PirateAccuracyIncreasing, Path.Combine(Utilities.AssemblyDirectory + @"\Quest Behaviors\SpecificQuests\Kalimdor\Thousand Needles"));
            CreateAFile(Path.Combine(Utilities.AssemblyDirectory + @"\Quest Behaviors\SpecificQuests\Kalimdor\Thousand Needles\25542-25543-CircleTheWagons.cs"),
                global::BrodiesPlugin.Properties.Resources._25542_25543_CircleTheWagons, Path.Combine(Utilities.AssemblyDirectory + @"\Quest Behaviors\SpecificQuests\Kalimdor\Thousand Needles"));
            CreateAFile(Path.Combine(Utilities.AssemblyDirectory + @"\Quest Behaviors\SpecificQuests\Kalimdor\Thousand Needles\27329-27330-InvokingTheSerpent.cs"),
                global::BrodiesPlugin.Properties.Resources._27329_27330_InvokingTheSerpent, Path.Combine(Utilities.AssemblyDirectory + @"\Quest Behaviors\SpecificQuests\Kalimdor\Thousand Needles"));

            CreateAFile(Path.Combine(Utilities.AssemblyDirectory + @"\Quest Behaviors\SpecificQuests\Pandaria\ForgeAhead-Hoku.cs"),
                global::BrodiesPlugin.Properties.Resources.ForgeAhead_Hoku, Path.Combine(Utilities.AssemblyDirectory + @"\Quest Behaviors\SpecificQuests\Pandaria"));
            CreateAFile(Path.Combine(Utilities.AssemblyDirectory + @"\Quest Behaviors\SpecificQuests\Pandaria\ForgeAhead-Itoka.cs"),
                global::BrodiesPlugin.Properties.Resources.ForgeAhead_Itoka, Path.Combine(Utilities.AssemblyDirectory + @"\Quest Behaviors\SpecificQuests\Pandaria"));

            CreateAFile(Path.Combine(Utilities.AssemblyDirectory + @"\Quest Behaviors\SpecificQuests\28320-BurningSteppes-AllianceAssaultonDreadmaulRock.cs"),
                global::BrodiesPlugin.Properties.Resources._28320_BurningSteppes_AllianceAssaultonDreadmaulRock, Path.Combine(Utilities.AssemblyDirectory + @"\Quest Behaviors\SpecificQuests"));
            CreateAFile(Path.Combine(Utilities.AssemblyDirectory + @"\Quest Behaviors\SpecificQuests\30264-VOEB-EnemyattheGates.cs"),
                global::BrodiesPlugin.Properties.Resources._30264_VOEB_EnemyattheGates, Path.Combine(Utilities.AssemblyDirectory + @"\Quest Behaviors\SpecificQuests"));
            CreateAFile(Path.Combine(Utilities.AssemblyDirectory + @"\Quest Behaviors\SpecificQuests\30266-VOEB-BloodiedSkies.cs"),
                global::BrodiesPlugin.Properties.Resources._30266_VOEB_BloodiedSkies, Path.Combine(Utilities.AssemblyDirectory + @"\Quest Behaviors\SpecificQuests"));
        }

        public static void UpdateAll()
        {
            MakeAllDir();

            // TheBrodieMan Specific
            File.WriteAllText(Path.Combine(Utilities.AssemblyDirectory + @"\Quest Behaviors\TBM\TheBrodieManHelper.cs"), global::BrodiesPlugin.Properties.Resources.TheBrodieManHelper);

            //Hooks
            File.WriteAllText(Path.Combine(Utilities.AssemblyDirectory + @"\Quest Behaviors\Hooks\TheEndlessFlowHook-Horde.cs"), global::BrodiesPlugin.Properties.Resources.TheEndlessFlowHook_Horde);

            // Darkmoon Faire
            File.WriteAllText(Path.Combine(Utilities.AssemblyDirectory + @"\Quest Behaviors\SpecificQuests\Darkmoon Faire\DMF_Cannon.cs"), global::BrodiesPlugin.Properties.Resources.DMF_Cannon);
            File.WriteAllText(Path.Combine(Utilities.AssemblyDirectory + @"\Quest Behaviors\SpecificQuests\Darkmoon Faire\DMF_Gnoll.cs"), global::BrodiesPlugin.Properties.Resources.DMF_Gnoll);
            File.WriteAllText(Path.Combine(Utilities.AssemblyDirectory + @"\Quest Behaviors\SpecificQuests\Darkmoon Faire\DMF_Shoot.cs"), global::BrodiesPlugin.Properties.Resources.DMF_Shoot);
            File.WriteAllText(Path.Combine(Utilities.AssemblyDirectory + @"\Quest Behaviors\SpecificQuests\Darkmoon Faire\DMF_Tonk.cs"), global::BrodiesPlugin.Properties.Resources.DMF_Tonk);
            File.WriteAllText(Path.Combine(Utilities.AssemblyDirectory + @"\Quest Behaviors\SpecificQuests\Darkmoon Faire\DMF_Turtle.cs"), global::BrodiesPlugin.Properties.Resources.DMF_Turtle);

            // Eastern Kingdoms
            // Silverpine Forest
            File.WriteAllText(Path.Combine(Utilities.AssemblyDirectory + @"\Quest Behaviors\SpecificQuests\Eastern Kingdoms\Silverpine Forest\27232-TheWatersRunRed.cs"), global::BrodiesPlugin.Properties.Resources._27232_TheWatersRunRed);
            // Tirisfal Glades
            File.WriteAllText(Path.Combine(Utilities.AssemblyDirectory + @"\Quest Behaviors\SpecificQuests\Eastern Kingdoms\Tirisfal Glades\24999-TirisfalGlades-PlantingtheSeedofFear.cs"), global::BrodiesPlugin.Properties.Resources._24999_TirisfalGlades_PlantingtheSeedofFear);
            // Western Plaguelands
            File.WriteAllText(Path.Combine(Utilities.AssemblyDirectory + @"\Quest Behaviors\SpecificQuests\Eastern Kingdoms\Western Plaguelands\26925-ArajTheSummoner.cs"), global::BrodiesPlugin.Properties.Resources._26925_ArajTheSummoner);
            File.WriteAllText(Path.Combine(Utilities.AssemblyDirectory + @"\Quest Behaviors\SpecificQuests\Eastern Kingdoms\Western Plaguelands\27164-ArajTheSummoner.cs"), global::BrodiesPlugin.Properties.Resources._27164_ArajTheSummoner);
            // Westfall
            File.WriteAllText(Path.Combine(Utilities.AssemblyDirectory + @"\Quest Behaviors\SpecificQuests\Eastern Kingdoms\Westfall\26257-ItsAlive.cs"), global::BrodiesPlugin.Properties.Resources._26257_ItsAlive);

            // Kalimdor
            // Ashenvale
            File.WriteAllText(Path.Combine(Utilities.AssemblyDirectory + @"\Quest Behaviors\SpecificQuests\Kalimdor\Ashenvale\13624-ASquadOfYourOwn.cs"), global::BrodiesPlugin.Properties.Resources._13624_ASquadOfYourOwn);
            File.WriteAllText(Path.Combine(Utilities.AssemblyDirectory + @"\Quest Behaviors\SpecificQuests\Kalimdor\Ashenvale\13853-ReturnFire.cs"), global::BrodiesPlugin.Properties.Resources._13853_ReturnFire);
            File.WriteAllText(Path.Combine(Utilities.AssemblyDirectory + @"\Quest Behaviors\SpecificQuests\Kalimdor\Ashenvale\13886-Vortex.cs"), global::BrodiesPlugin.Properties.Resources._13886_Vortex);
            File.WriteAllText(Path.Combine(Utilities.AssemblyDirectory + @"\Quest Behaviors\SpecificQuests\Kalimdor\Ashenvale\13888-Vortex.cs"), global::BrodiesPlugin.Properties.Resources._13888_Vortex);
            File.WriteAllText(Path.Combine(Utilities.AssemblyDirectory + @"\Quest Behaviors\SpecificQuests\Kalimdor\Ashenvale\13935-DefendTheTree.cs"), global::BrodiesPlugin.Properties.Resources._13935_DefendTheTree);
            // Azshara
            File.WriteAllText(Path.Combine(Utilities.AssemblyDirectory + @"\Quest Behaviors\SpecificQuests\Kalimdor\Azshara\14134-TheCaptainsLogs.cs"), global::BrodiesPlugin.Properties.Resources._14134_TheCaptainsLogs);
            File.WriteAllText(Path.Combine(Utilities.AssemblyDirectory + @"\Quest Behaviors\SpecificQuests\Kalimdor\Azshara\14135-UpATree.cs"), global::BrodiesPlugin.Properties.Resources._14135_UpATree);
            File.WriteAllText(Path.Combine(Utilities.AssemblyDirectory + @"\Quest Behaviors\SpecificQuests\Kalimdor\Azshara\14146-DefendTheGates.cs"), global::BrodiesPlugin.Properties.Resources._14146_DefendTheGates);
            File.WriteAllText(Path.Combine(Utilities.AssemblyDirectory + @"\Quest Behaviors\SpecificQuests\Kalimdor\Azshara\14155-Arborcide.cs"), global::BrodiesPlugin.Properties.Resources._14155_Arborcide);
            File.WriteAllText(Path.Combine(Utilities.AssemblyDirectory + @"\Quest Behaviors\SpecificQuests\Kalimdor\Azshara\14226-TroubleUnderFoot.cs"), global::BrodiesPlugin.Properties.Resources._14226_TroubleUnderFoot);
            File.WriteAllText(Path.Combine(Utilities.AssemblyDirectory + @"\Quest Behaviors\SpecificQuests\Kalimdor\Azshara\14310-SegmentationFault.cs"), global::BrodiesPlugin.Properties.Resources._14310_SegmentationFault);
            File.WriteAllText(Path.Combine(Utilities.AssemblyDirectory + @"\Quest Behaviors\SpecificQuests\Kalimdor\Azshara\KillShredder.cs"), global::BrodiesPlugin.Properties.Resources.KillShredder);
            // Azuremyst Isle
            File.WriteAllText(Path.Combine(Utilities.AssemblyDirectory + @"\Quest Behaviors\SpecificQuests\Kalimdor\AzuremystIsle\9544-TheProphecyofAkida.cs"), global::BrodiesPlugin.Properties.Resources._9544_TheProphecyofAkida);
            // Darkshore
            File.WriteAllText(Path.Combine(Utilities.AssemblyDirectory + @"\Quest Behaviors\SpecificQuests\Kalimdor\Darkshore\13514-TheAncientsIre.cs"), global::BrodiesPlugin.Properties.Resources._13514_TheAncientsIre);
            File.WriteAllText(Path.Combine(Utilities.AssemblyDirectory + @"\Quest Behaviors\SpecificQuests\Kalimdor\Darkshore\13588-EyeofAllStorms.cs"), global::BrodiesPlugin.Properties.Resources._13588_EyeofAllStorms);
            File.WriteAllText(Path.Combine(Utilities.AssemblyDirectory + @"\Quest Behaviors\SpecificQuests\Kalimdor\Darkshore\13885-DefenseOfDarkshore.cs"), global::BrodiesPlugin.Properties.Resources._13885_DefenseOfDarkshore);
            // Southern Barrens
            File.WriteAllText(Path.Combine(Utilities.AssemblyDirectory + @"\Quest Behaviors\SpecificQuests\Kalimdor\Southern Barrens\24546-ALineInTheDirt.cs"), global::BrodiesPlugin.Properties.Resources._24546_ALineInTheDirt);
            File.WriteAllText(Path.Combine(Utilities.AssemblyDirectory + @"\Quest Behaviors\SpecificQuests\Kalimdor\Southern Barrens\24939-RunOutTheGuns.cs"), global::BrodiesPlugin.Properties.Resources._24939_RunOutTheGuns);
            File.WriteAllText(Path.Combine(Utilities.AssemblyDirectory + @"\Quest Behaviors\SpecificQuests\Kalimdor\Southern Barrens\25045-ALineInTheDirt.cs"), global::BrodiesPlugin.Properties.Resources._25045_ALineInTheDirt);
            // Stonetalon Mountains
            File.WriteAllText(Path.Combine(Utilities.AssemblyDirectory + @"\Quest Behaviors\SpecificQuests\Kalimdor\Stonetalon Mountains\25614-TheOnlyWayDown.cs"), global::BrodiesPlugin.Properties.Resources._25614_TheOnlyWayDown);
            File.WriteAllText(Path.Combine(Utilities.AssemblyDirectory + @"\Quest Behaviors\SpecificQuests\Kalimdor\Stonetalon Mountains\25652-CommandeerThatBalloon.cs"), global::BrodiesPlugin.Properties.Resources._25652_CommandeerThatBalloon);
            File.WriteAllText(Path.Combine(Utilities.AssemblyDirectory + @"\Quest Behaviors\SpecificQuests\Kalimdor\Stonetalon Mountains\25889-SaveTheChildren.cs"), global::BrodiesPlugin.Properties.Resources._25889_SaveTheChildren);
            File.WriteAllText(Path.Combine(Utilities.AssemblyDirectory + @"\Quest Behaviors\SpecificQuests\Kalimdor\Stonetalon Mountains\26028-MrDsWildRide.cs"), global::BrodiesPlugin.Properties.Resources._26028_MrDsWildRide);
            // Thousand Needles
            File.WriteAllText(Path.Combine(Utilities.AssemblyDirectory + @"\Quest Behaviors\SpecificQuests\Kalimdor\Thousand Needles\25532-25533-PirateAccuracyIncreasing.cs"), global::BrodiesPlugin.Properties.Resources._25532_25533_PirateAccuracyIncreasing);
            File.WriteAllText(Path.Combine(Utilities.AssemblyDirectory + @"\Quest Behaviors\SpecificQuests\Kalimdor\Thousand Needles\25542-25543-CircleTheWagons.cs"), global::BrodiesPlugin.Properties.Resources._25542_25543_CircleTheWagons);
            File.WriteAllText(Path.Combine(Utilities.AssemblyDirectory + @"\Quest Behaviors\SpecificQuests\Kalimdor\Thousand Needles\27329-27330-InvokingTheSerpent.cs"), global::BrodiesPlugin.Properties.Resources._27329_27330_InvokingTheSerpent);

            // Pandaria
            File.WriteAllText(Path.Combine(Utilities.AssemblyDirectory + @"\Quest Behaviors\SpecificQuests\Pandaria\ForgeAhead-Hoku.cs"), global::BrodiesPlugin.Properties.Resources.ForgeAhead_Hoku);
            File.WriteAllText(Path.Combine(Utilities.AssemblyDirectory + @"\Quest Behaviors\SpecificQuests\Pandaria\ForgeAhead-Itoka.cs"), global::BrodiesPlugin.Properties.Resources.ForgeAhead_Itoka);
            // Uncategorized (Can not move from root)
            File.WriteAllText(Path.Combine(Utilities.AssemblyDirectory + @"\Quest Behaviors\SpecificQuests\28320-BurningSteppes-AllianceAssaultonDreadmaulRock.cs"), global::BrodiesPlugin.Properties.Resources._28320_BurningSteppes_AllianceAssaultonDreadmaulRock);
            File.WriteAllText(Path.Combine(Utilities.AssemblyDirectory + @"\Quest Behaviors\SpecificQuests\30264-VOEB-EnemyattheGates.cs"), global::BrodiesPlugin.Properties.Resources._30264_VOEB_EnemyattheGates);
            File.WriteAllText(Path.Combine(Utilities.AssemblyDirectory + @"\Quest Behaviors\SpecificQuests\30266-VOEB-BloodiedSkies.cs"), global::BrodiesPlugin.Properties.Resources._30266_VOEB_BloodiedSkies);
        }

        public static void CreateAFile(string filePath, string createFile, string dir)
        {
            if (!File.Exists(filePath))
            {
                if (!Directory.Exists(dir))
                    Directory.CreateDirectory(dir);
                File.WriteAllText(filePath, createFile);
                BrodiesPlugin.BrodiesPlugin.brodieupdated = true;
            }
        }

        public static void MakeAllDir()
        {
            CheckMakeDir(Path.Combine(Utilities.AssemblyDirectory + @"\Quest Behaviors\TBM"));
            CheckMakeDir(Path.Combine(Utilities.AssemblyDirectory + @"\Quest Behaviors\Hooks"));
            CheckMakeDir(Path.Combine(Utilities.AssemblyDirectory + @"\Quest Behaviors\SpecificQuests\Darkmoon Faire"));

            CheckMakeDir(Path.Combine(Utilities.AssemblyDirectory + @"\Quest Behaviors\SpecificQuests\Eastern Kingdoms\Silverpine Forest"));
            CheckMakeDir(Path.Combine(Utilities.AssemblyDirectory + @"\Quest Behaviors\SpecificQuests\Eastern Kingdoms\Tirisfal Glades"));
            CheckMakeDir(Path.Combine(Utilities.AssemblyDirectory + @"\Quest Behaviors\SpecificQuests\Eastern Kingdoms\Western Plaguelands"));
            CheckMakeDir(Path.Combine(Utilities.AssemblyDirectory + @"\Quest Behaviors\SpecificQuests\Eastern Kingdoms\Westfall"));

            CheckMakeDir(Path.Combine(Utilities.AssemblyDirectory + @"\Quest Behaviors\SpecificQuests\Kalimdor\Ashenvale"));
            CheckMakeDir(Path.Combine(Utilities.AssemblyDirectory + @"\Quest Behaviors\SpecificQuests\Kalimdor\Azshara"));
            CheckMakeDir(Path.Combine(Utilities.AssemblyDirectory + @"\Quest Behaviors\SpecificQuests\Kalimdor\AzuremystIsle"));
            CheckMakeDir(Path.Combine(Utilities.AssemblyDirectory + @"\Quest Behaviors\SpecificQuests\Kalimdor\Darkshore"));
            CheckMakeDir(Path.Combine(Utilities.AssemblyDirectory + @"\Quest Behaviors\SpecificQuests\Kalimdor\Southern Barrens"));
            CheckMakeDir(Path.Combine(Utilities.AssemblyDirectory + @"\Quest Behaviors\SpecificQuests\Kalimdor\Stonetalon Mountains"));
            CheckMakeDir(Path.Combine(Utilities.AssemblyDirectory + @"\Quest Behaviors\SpecificQuests\Kalimdor\Thousand Needles"));

            CheckMakeDir(Path.Combine(Utilities.AssemblyDirectory + @"\Quest Behaviors\SpecificQuests\Pandaria"));
        }

        public static void CheckMakeDir(string dir)
        {
            if (!Directory.Exists(dir))
                Directory.CreateDirectory(dir);
        }
	}
}